<?php
$link = mysql_connect('localhost', 'root', '1');
if (!$link) {
    die('<br>Ошибка соединения: ' . mysql_error());
}

mysql_query ('SET NAMES utf8');
mysql_query ('SET CHARACTER SET utf8');
mysql_set_charset('utf8',$link);

$db_selected = mysql_select_db('melagranoru', $link);

?>